package org.csmz.exption01;

public class Example23 {
    public static int divide(int num1, int num2){
        if(num2== 0){
            throw new ArithmeticException("除数不能为0");
        }
        return num1 / num2;
    }
    public static void main(String[] args){
        int num1 = 10;
        int num2 = 0;
        int result = divide(num1,num2);
        System.out.println("结果为：" +result);
    }
}
